﻿using System;
using ManagedCuda;
using RayDen.RayEngine.Core.Types;

namespace RayDen.RayEngine.IntersectionEngines.Cuda
{
    public class CudaSampleBuffer : DeviceSampleBuffer<CudaDeviceVariable<SampleBufferElem>>, IDisposable
    {
        public CudaSampleBuffer(int size) : base(size)
        {
            this.Buffer = new CudaDeviceVariable<SampleBufferElem>(size);
        }

        public void Write(SampleBufferElem[] elements)
        {
            this.Buffer.CopyToDevice(elements);
        }

        public void Dispose()
        {
            this.Buffer.Dispose();
        }
    }
}